package jedicourse.jduplessy.exercisesChapter6.core;

import java.lang.Math;

/**
 * 
 * @author jd09008
 *
 */

public class Punto2D {
	
	private double x, y;
	
	public Punto2D(){
		this.x = 0.0;
		this.y= 0.0;
	}
	
	public Punto2D(double x, double y){
		this.x = x;
		this.y = y;
	}
	
	/*
	 * methods
	 */
	
	public void trasladePoints(double x, double y){
		this.x = x;
		this.y = y;
	}
	
	public double calculateDistance(Punto2D Punto2D){
			
		return Math.sqrt(Math.pow((this.x - Punto2D.x), 2) + Math.pow(this.y - Punto2D.y, 2)); 
				
	}

	public double calculateDistance(){
		
		return Math.sqrt(Math.pow((this.x - 0), 2) + Math.pow(this.y - 0, 2)); 
				
	}
		

	/* 
	 * getters and setters 
	 */
	
	public double getX(){
		return this.x;
	}
	
	public double getY(){
		return this.y;
	}
	
	public void setX(double x){
		this.x = x;
	}
	
	public void setY(double y){
		this.y = y;
	}
	

}
